<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      table {
        width: 500px;
        height: 300px;
        border-collapse: collapse;
        margin: 0 auto;
        text-align: center;
      }
      table > tbody > tr:nth-of-type(2n + 1) {
        background-color: #bbe4cf;
      }
      table > tbody > tr:nth-of-type(2n) {
        background-color: #c6e5f1;
      }

      table > tbody > tr:hover {
        background-color: #ccc;
      }
      table > tbody > tr > td:hover {
        background-color: #05e964;
      }
    </style>
  </head>
  <body>
    <table border="1">
      <thead>
        <tr>
          <th>序号</th>
          <th>姓名</th>
          <th>性别</th>
          <th>年龄</th>
        </tr>
      </thead>
      <tr>
        <td>1</td>
        <td>张三</td>
        <td>男</td>
        <td>22</td>
      </tr>
      <tr>
        <td>2</td>
        <td>张三</td>
        <td>男</td>
        <td>22</td>
      </tr>
      <tr>
        <td>3</td>
        <td>张三</td>
        <td>男</td>
        <td>22</td>
      </tr>
      <tr>
        <td>4</td>
        <td>张三</td>
        <td>男</td>
        <td>22</td>
      </tr>
    </table>
  </body>
</html>
